<%@ Register TagPrefix="uc1" TagName="Footer" Src="../Controls/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="../Controls/Header.ascx" %>
<%@ Page Language="vb" validateRequest="false" AutoEventWireup="false" Codebehind="OrderView.aspx.vb" Inherits="MIMS_WRS.Web.OrderView"%>
<%@ Register TagPrefix="uc1" TagName="HelpCtrl" Src="../Controls/HelpCtrl.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Order View</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="../style.css" type="text/css" rel="stylesheet">
		<script language="JavaScript" src="../js/function.js" type="text/JavaScript"></script>
		<script language="javascript" src="../Js/popcalendar.js"></script>
		<script language="javascript" src="../Js/common.js"></script>
		<script language="javascript">
			<!--
			// Constants ///////////////////////////////////////////////
			var PERMANENTLY_REMOVE_ORDER_WARNING_MSG = "Are you sure you want to permanently remove the order?"
			///////////////////////////////////////

			var destPortLKID = <%= MIMS_WRS.Business.Common.GetDestinationPortLKID %>;
			var sortRefLKID = <%= MIMS_WRS.Business.Common.GetSortRefLKID %>;
			var sortRef2LKID = <%= MIMS_WRS.Business.Common.GetSortRef2LKID %>;
			var sortRangeLKID = <%= MIMS_WRS.Business.Common.GetSortRangeLKID %>;
			var supplierCodeLKID = <%= MIMS_WRS.Business.Common.GetSupplierCodeLKID %>;
			
			var viewOrderID = <%= PageBO.ID %>;
			var cnt=0;				
			var orderItemCount = <%= PageBO.OrderItems.Count %>;
						
			function Check_Onclick(obj) {
				if (obj.checked) 
					cnt++;
				else
					cnt--;
			}

			function body_onload() {
				
				SwitchETA();
			
				if (window.document.getElementById('btnSaveOrder'))
					window.document.getElementById('btnSaveOrder').onclick = btnSubmit_onclick;
					
				if (window.document.getElementById('btnRemove'))
					window.document.getElementById('btnRemove').onclick = btnRemove_onclick;

				if (window.document.getElementById('btnPerRemove'))
					window.document.getElementById('btnPerRemove').onclick = btnPerRemove_onclick;

				if (window.document.getElementById('btnAddOI'))
					window.document.getElementById('btnAddOI').onclick = btnAddOI_onclick;

				if (window.document.getElementById('btnRemoveOI'))
					window.document.getElementById('btnRemoveOI').onclick = btnRemoveOI_onclick;
					
				if (window.document.getElementById('btnArchived'))
					window.document.getElementById('btnArchived').onclick = btnArchived_onclick;
			}

			function btnAddOI_onclick() {
				var cid = <%= PageBO.CustomerID %>;
				var oitype = <%= PageBO.OrderItemType %>;
				var type = <%= PageBO.OrderType %>;

				var w = 550;
				var h = 390;
				var lpos=(screen.width - w)/2
				var tpos=(screen.height - h)/2		
				
				var reval;
				var title = "Enter new product item";
				var url=escape('ProductItemDialog.aspx?idx=-1&type='+type+'&cid='+cid+'&oitype='+oitype);
				reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ h +"px; dialogWidth: "+ w +"px; dialogTop: "+ tpos +"px; dialogLeft: "+ lpos +"px; edge: Raised; center: Yes; help: No; scroll: No; resizable: No; status: No;")
				if (reval != null)
					return true;
				else
					return false;
			}

			function btnRemoveOI_onclick() {
				if(orderItemCount<=1 || cnt==orderItemCount)
				{
					alert("Each order must have at least one product.");
					return false;				
				}
				
				if (cnt>0) {
					return confirm("Are you sure you want to delete?");
				} else {
					alert("Please select item to delete!");
					return false;				
				}
			}

			function btnRemove_onclick() {
				return confirm('Are you sure you want to remove?');
			}

			function btnPerRemove_onclick() {
				return confirm(PERMANENTLY_REMOVE_ORDER_WARNING_MSG);
			}

			function btnArchived_onclick() {
				return confirm('Are you sure you want to make archived?');
			}
			
			function CreateOrderCompleteInformation() {			
				var w = 500;
				var h = 300;
				var lpos=(screen.width - w)/2
				var tpos=(screen.height - h)/2		

				var reval;
				var title = "Order Complete Information";
				var url=escape('CreateOrderCompleteInfo.aspx?id=' + viewOrderID);
				reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ h +"px; dialogWidth: "+ w +"px; dialogTop: " + tpos + " px; dialogLeft: " + lpos + " px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scrolls: Yes;")
				if (reval != null) {
					window.document.getElementById('btnRefresh').click();
					
					return true;
				}
				return false;
			}
			
			function btnEdit_onclick(idx) {
				var w = 550;
				var h = 390;
				var lpos=(screen.width - w)/2
				var tpos=(screen.height - h)/2		

				var reval;
				var type = <%= PageBO.OrderType %>;
				var cid = <%= PageBO.CustomerID %>;
				var oitype = <%= PageBO.OrderItemType %>;
				var title = "Update product item";
				var url=escape('ProductItemDialog.aspx?idx='+ idx +'&type='+type+'&oitype='+oitype+'&cid='+cid);
				reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ h +"px; dialogWidth: "+ w +"px; dialogTop: "+ tpos +"px; dialogLeft: "+ lpos +"px; edge: Raised; center: Yes; help: No; scroll: No; resizable: No; status: No;")
				if (reval != null)
					return true;
				else
					return false;			
			}
			
		function UIInit() {
			var tb = window.document.getElementById('dgItems');
			var ddl = window.document.getElementById('ddlOrderType');
			var ddlOIT = document.all['ddlOrderItemType'];
			if (tb.rows.length>1) {
				ddl.disabled = true;					
				ddlOIT.disabled = true;		
			} else {
				ddl.disabled = false;
				ddlOIT.disabled = false;
			}							
			
			OrderType_onchange();
		}
		
		function OrderType_onchange() {
			var tdOIType = document.all['tdOIType'];
			var ddl = window.document.getElementById('ddlOrderType');
			if (ddl.selectedIndex>0) // Bulk Order
			{
				tdOIType.style.display = "none";
			}
			else  // Purchase Order 
			{
				tdOIType.style.display = "";
			}
		}
		
		function btnCancel_onclick() {
			return confirm('Are you sure you want to cancel?');
		}
		
		function validateOrderNumberLength() {
			var ddl = window.document.getElementById('ddlOrderType');
			var txt = window.document.getElementById('txtOrderNo');
			var OK;
			if (ddl.selectedIndex==0) //PO
				OK = (txt.value.length>=3 && txt.value.length <= 10);
			else
				OK = (txt.value.length == 3) && IsAllDigitChar(txt.value);
			if (!OK) {
				alert('Invalid order number.\nMust be 3-10 alphanumeric characters for PO, 3 fixed numeric characters for BO');				
				txt.focus();
			}
			return OK;
		}
		
		function validateETADate() {
			var rads = window.document.getElementsByName("RequestedETA");
			var txtETABefore = window.document.getElementById('txtETABefore')
			var txtETAAfter = window.document.getElementById('txtETAAfter')
			var txtETAFrom = window.document.getElementById('txtETAFrom')
			var txtETATo = window.document.getElementById('txtETATo')
						
			if (rads[1].checked && !isValueExists(txtETABefore)) {
				alert('Please input ETA Before date');
				txtETABefore.focus();
				return false;
			}
			
			if (rads[2].checked && !isValueExists(txtETAAfter)) {
				alert('Please input ETA After date');
				txtETAAfter.focus();
				return false;
			}
			
			if (rads[3].checked && !isValueExists(txtETAFrom)) {
				alert('Please input ETA Between date');
				txtETAFrom.focus();
				return false;
			}
			
			if (rads[3].checked && !isValueExists(txtETATo)) {
				alert('Please input ETA To date');
				txtETATo.focus();
				return false;
			}
			
			if(rads[1].checked)//ETA Before Date must be greater than Order Date.
			{
				if (!CompareDate(window.document.getElementById('txtOrderDate'), window.document.getElementById('txtETABefore'))) {
					alert('ETA date is invalid. "Before Date" must be greater than "Order Date"');
					txtETABefore.focus();
					return false;
				}				
			}

			if(rads[2].checked)//ETA After Date must be greater than Order Date.
			{
				if (!CompareDate(window.document.getElementById('txtOrderDate'), window.document.getElementById('txtETAAfter'))) {
					alert('ETA date is invalid. "After Date" must be greater than "Order Date"');
					txtETAAfter.focus();
					return false;
				}				
			}
				
			if (rads[3].checked) { // From date1 to date2			
				if (!CompareDate(window.document.getElementById('txtETAFrom'), window.document.getElementById('txtETATo'))) {
					alert('ETA date is invalid. "To Date" must be greater than or equal "Between Date"');
					txtETATo.focus();
					return false;
				}				
				
				if (!CompareDate(window.document.getElementById('txtOrderDate'), window.document.getElementById('txtETAFrom'))) {
					alert('ETA date is invalid. "From Date" must be greater than "Order Date"');
					txtETAFrom.focus();
					return false;
				}				
				
				if (!CompareDate(window.document.getElementById('txtOrderDate'), window.document.getElementById('txtETATo'))) {
					alert('ETA date is invalid. "To Date" must be greater than "Order Date"');
					txtETATo.focus();
					return false;
				}				
			}	
			return true;			
		}
		
		function isValueExists(txt) {
			return  txt.value != "";
		}
		
		var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
		function FindMonths(mth) {
			var i;
			for (i=0; i<12; i++) 
				if (months[i]==mth)
					return i+1;
			return 0;
		}					
				
		function CompareDate(txtdate1, txtdate2) {							
			// format of date: dd/MMM/yy   ex: 02/Jan/2003
			// date2 must be greater than or equal date1			
			
			if (txtdate2 == null || txtdate1 == null) 
				return false;
			else {			
				if (txtdate2.value == "" || txtdate1.value == "")
					return false;
				var d1 = parseInt(txtdate1.value.substr(0, 2) , 10)					
				var d2 = parseInt(txtdate2.value.substr(0, 2) , 10)
				var m1 = FindMonths(txtdate1.value.substr(3, 3))
				var m2 = FindMonths(txtdate2.value.substr(3, 3))
				var y1 = parseInt(txtdate1.value.substr(7, 4) , 10)
				var y2 = parseInt(txtdate2.value.substr(7, 4) , 10)					
				return ((y2>y1) || (y2==y1 && m2>m1) || (y2==y1 && m2==m1 && d2>=d1))
			}				
		}

		function validateOrderItem() {
			var tb = window.document.getElementById('dgItems');
			if (tb.rows.length>1) {
				return true;
			} else {
				alert("Order must has at least one product");
				return false;
			}					
		}
		
		function btnSubmit_onclick() {
			//if (!validateOrderNumberLength())
			//	return false;			
			if (!validateETADate())
				return false;
			//if (!validateOrderItem())
			//	return false;
				
			if (typeof(Page_ClientValidate) == 'function') 
				return Page_ClientValidate();
							
			return true;
		}
		
		
		function btnEdit_onclick(idx) {
			var w = 550;
			var h = 390;
			var lpos=(screen.width - w)/2
			var tpos=(screen.height - h)/2		

			var reval;
			//var type = window.document.getElementById('ddlOrderType').selectedIndex;
			var type = <%= PageBO.OrderType %>;
			//var cid=document.all['hidCustomerID'].value;
			var cid = <%= PageBO.CustomerID %>;
			//var oitype=document.all['ddlOrderItemType'].options[document.all['ddlOrderItemType'].selectedIndex].value;
			var oitype = <%= PageBO.OrderItemType %>;
			var title = "Update product item";
			var url=escape('ProductItemDialog.aspx?idx='+ idx +'&type='+type+'&oitype='+oitype+'&cid='+cid);
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ h +"px; dialogWidth: "+ w +"px; dialogTop: "+ tpos +"px; dialogLeft: "+ lpos +"px; edge: Raised; center: Yes; help: No; scroll: No; resizable: No; status: No;")
			if (reval != null)
				return true;
			else
				return false;			
		}
							
		function IsCustomerEntered() {
			var id=parseInt(window.document.getElementById('hidCustomerID').value, 10);	
			if (id>0) {
				return id;
			} else {
				alert('Please select a customer first');
				return -1;
			}
		}
		
		function IsOrderHasItem() {		
			if (checkBoxCount('dgItems__ctl###_chkSelection','###', 2)>0)
				return true;
			else
				return false;		
		}
				
		function CheckBeforeUpdateCustomer() {
			if (IsOrderHasItem()) {
				alert('Please remove all order items to change customer');
				return false;
			}
			else
				return true;
		}
						
		function OpenCustomerList(obj) {			
			if (!CheckBeforeUpdateCustomer()) return false;
			var pos = calcBelowPosition(obj,1,190,220);	
			var w = 550;
			var h = 350;
			lpos=(screen.width - w)/2
			tpos=(screen.height - h)/2		
			var reval;
			var title = "Select a customer";
			//var url=escape('UserListDialog.aspx?type=0');			
			var url=escape('popup_customer.htm');			
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: 350px; dialogWidth: 550px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				window.document.getElementById('txtCustomerName').value = reval.Name;
				window.document.getElementById('hidCustomerID').value = reval.ID;
				window.document.getElementById('txtOrderBy').value = "";
				window.document.getElementById('hidContactID').value = "0";
				return true;
			}
			return false;
		}
		
		function AddNewCustomer(obj) {			
			if (!CheckBeforeUpdateCustomer()) return false;
			var w = 600;
			var h = 400;
			var lpos=(screen.width - w)/2
			var tpos=(screen.height - h)/2		

			var reval;
			var title = "Enter a new customer";
			var url=escape('NewCustomerDialog.aspx');
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: 400px; dialogWidth: 600px; dialogTop: " + tpos + " px; dialogLeft: " + lpos + " px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scrolls: Yes;")
			
			if (reval != null) {
				window.document.getElementById('txtCustomerName').value = reval.Name;
				window.document.getElementById('hidCustomerID').value = reval.ID;	
				window.document.getElementById('txtOrderBy').value = "";
				window.document.getElementById('hidContactID').value = "0";
				return true;
			}
			return false;
		}
		
		function OpenCCList(obj) {
			var id = IsCustomerEntered();
			if (id<0) return false;			
			
			var pos = calcBelowPosition(obj,1,190,220);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;
			var title = "Select a contact for this customer";
			//var url=escape('CustomerContactListDialog.aspx?cid='+id);			
			var url=escape('Popup_Contact.aspx?cid='+id);			
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ he +"px; dialogWidth: "+ wi +"px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				window.document.getElementById('txtOrderBy').value = reval.Name;
				window.document.getElementById('hidContactID').value = reval.ID;				
				return true;
			}
			return false;
		}
		
		function AddCC(obj) {
			var id = IsCustomerEntered();
			if (id<0) return false;
			
			var w = 250;
			var pos = calcBelowPosition(obj,1,w,135);			
			var wi = 360;
			var he = 140;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;
			var title = "Enter a new contact for this customer";
			var url=escape('CustomerContactDialog.aspx?cid='+id);			
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: "+ he +"px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				window.document.getElementById('txtOrderBy').value = reval.Name;
				window.document.getElementById('hidContactID').value = reval.ID;				
				return true;
			}
			return false
		}
		
		function OpenLKList(obj,  textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;			
			//var url=escape('LookupDataListDialog.aspx?id='+id+'&t='+valueno);
			var url = escape('popup_desport.htm');
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + he + "px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				textReturn.value = reval.Text;
				idReturn.value = reval.Value;
				return true;
			}
			return false
		}

		function OpenSupplierCodeList(obj,  textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;			
			//var url=escape('LookupDataListDialog.aspx?id='+id+'&t='+valueno);
			var url = escape('popup_supplier.htm');
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + he + "px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				textReturn.value = reval.Text;
				idReturn.value = reval.Value;
				return true;
			}
			return false
		}
		
		
		function OpenSortReferenceList(obj,  textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;			
			//var url=escape('LookupDataListDialog.aspx?id='+id+'&t='+valueno);
			var url = escape('popup_sortref.htm');
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + he + "px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				textReturn.value = reval.Text;
				idReturn.value = reval.Value;
				return true;
			}
			return false
		}

		function OpenSortReference2List(obj,  textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;			
			//var url=escape('LookupDataListDialog.aspx?id='+id+'&t='+valueno);
			var url = escape('popup_sortref2.htm');
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + he + "px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				textReturn.value = reval.Text;
				idReturn.value = reval.Value;
				return true;
			}
			return false
		}
		
		function OpenDestPortList(obj,  textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);			
			var wi = 550;
			var he = 350;
			var lpos=(screen.width - wi)/2
			var tpos=(screen.height - he)/2		

			var reval;			
			var url=escape('LookupDataListDialog.aspx?id='+id+'&t='+valueno);
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + he + "px; dialogWidth: " + wi + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			
			if (reval != null) {
				textReturn.value = reval.Text;
				idReturn.value = reval.Value;
				return true;
			}
			return false
		}

		
		function AddLK(obj, textReturn, idReturn, title, w, h, id, valueno) {
			var pos = calcBelowPosition(obj,1,w,h);
			var lpos=(screen.width - w)/2
			var tpos=(screen.height - h)/2		

			var reval;
			var url = escape('LookupDataInputDialog.aspx?id='+id);
			reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + h + "px; dialogWidth: " + w + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
			if (reval != null) {
				switch (valueno) {
					case 1:
						textReturn.value = reval.Value1;
						break;
					case 2:
						textReturn.value = reval.Value2;
						break;
					case 3:
						textReturn.value = reval.Value3;
						break;
				}
				idReturn.value = reval.ID;			
				return true;
			}
			return false
		}
		
		function SwitchETA() {
		
			if(!window.document.getElementById('btnETABefore'))
				return true;
		
			var rads = window.document.getElementsByName("RequestedETA");
			var i;
			window.document.getElementById('txtETABefore').disabled=true;
			window.document.getElementById('btnETABefore').style.display = "none";
			window.document.getElementById('txtETAAfter').disabled=true;
			window.document.getElementById('btnETAAfter').style.display = "none";
			window.document.getElementById('txtETAFrom').disabled=true;
			window.document.getElementById('btnETAFrom').style.display = "none";
			window.document.getElementById('txtETATo').disabled=true;
			window.document.getElementById('btnETATo').style.display = "none";
			
			for (i=0; i<rads.length; i++) 
				if (rads[i].checked)
					switch (i) {
						case 0:							
							break;
						case 1:
							window.document.getElementById('btnETABefore').style.display = "";
							window.document.getElementById('txtETABefore').disabled=false;
							break;
						case 2:
							window.document.getElementById('btnETAAfter').style.display = "";
							window.document.getElementById('txtETAAfter').disabled=false;
							break;
						case 3:
							window.document.getElementById('btnETAFrom').style.display = "";
							window.document.getElementById('txtETAFrom').disabled=false;
							window.document.getElementById('btnETATo').style.display = "";
							window.document.getElementById('txtETATo').disabled=false;
							break;
					}
					
		}
		
		function Form1_onsubmit() {
			var txt = window.document.getElementById('txtPos');
			txt.value = window.document.body.scrollTop;
			
			var ddl = window.document.getElementById('ddlOrderType');
			ddl.disabled = false;
			
			window.document.all['ddlOrderItemType'].disabled = false;
		}
	
		function changepo(){
			var ddlCtrl = window.document.getElementById('ddlOrderType');
			if(ddlCtrl.options[1].selected){
				po.innerText='Customer BO#:';
			}
			else
			{
				document.Form1.reset();
				po.innerText='Customer PO#:';
			}
		}
			
			//-->
		</script>
	</HEAD>
	<body leftMargin="0" topMargin="0" onload="body_onload();MM_preloadImages('../images/b_weeklyreporto.gif','../images/b_historyreporto.gif','../images/b_usero.gif')">
		<form id="Form1" method="post" runat="server">
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<uc1:header id="Header1" runat="server"></uc1:header>
				<!-- Submenu: start -->
				<tr>
					<td class="bgsubmenu" align="center" height="30">
						<div class="nlink">
							<table cellSpacing="0" cellPadding="0" width="96%" border="0">
								<tr>
									<td class="txtcolor2"><span class="txtsmall"><strong>You are here:</strong></span> <A href="../Internal/OrderList.aspx" runat="server" id="hrefOrderList">
											Order list</A> /
										<asp:label id="lblPathName" runat="server">Order Information</asp:label></td>
									<td class="txtcolor2" align="right">
										<p><A href="../Internal/OrderInput.aspx"><strong><asp:label id="lblCreateNewOrder" runat="server">Create New Order</asp:label></strong></A></p>
									</td>
									<td class="txtcolor2" noWrap align="right" width="70"><span class="plink"><A href="javascript:history.back()"><IMG height="16" hspace="2" src="../images/b_back.gif" width="57" vspace="0" border="0"></A></span></td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr>
					<td height="1" class="bglinetop1"><img src="../images/1pxl.gif" width="1" height="1"></td>
				</tr>
				<!-- Submenu: end -->
				<!-- DataTable: start -->
				<tr>
					<td class="bgwhite" align="center">
						<table cellSpacing="0" cellPadding="0" width="90%" border="0">
							<tr>
								<td align="center" height="10"><IMG height="1" src="../images/1pxl.gif" width="1"></td>
							</tr>
							<tr>
								<td align="center" height="35">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td vAlign="bottom" width="56%" height="25"><span class="title"><strong><strong><asp:label id="lblTitle" runat="server">ORDER INFORMATION</asp:label></strong></strong></span></td>
											<td vAlign="bottom" align="right" width="44%"><div class="plink"><strong><span class="txtsmall"><strong><strong>
																	<A href="javascript:OpenPrintWindow('OrderView_Print.aspx', 800, 600)">::Print</A>
																	|
																	<uc1:HelpCtrl id="HelpCtrl1" runat="server"></uc1:HelpCtrl>&nbsp; </strong></strong>
														</span></strong>
												</div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td><asp:label id="lblErr" runat="server" CssClass="txthighlight"></asp:label></td>
							</tr>
							<tr>
								<td vAlign="top" align="center">
									<table class="border1" cellSpacing="2" cellPadding="2" width="100%" border="0">
										<tr>
											<td align="center" bgColor="#f9f9f9">
												<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
													<TR>
														<TD class="bgmenu" align="right" height="20">
															<table cellSpacing="0" cellPadding="0" width="100%" border="0">
																<tr>
																	<td class="txtnormal"><strong>&nbsp;Order Information</strong></td>
																	<td align="right"><asp:imagebutton id="btnEditOrder" runat="server" ImageUrl="../Images/b_edit.gif" border="0" vspace="2"
																			width="70" hspace="2" height="18"></asp:imagebutton><asp:imagebutton id="btnSaveOrder" runat="server" ImageUrl="../Images/b_save1.gif" border="0" vspace="2"
																			width="70" hspace="2" height="18" Visible="False"></asp:imagebutton></td>
																</tr>
															</table>
														</TD>
													</TR>
													<!-- View Order Form: start -->
													<TR id="trViewOrder" runat="server">
														<TD class="txtnormal" align="center">
															<table class="bglinetop1" cellSpacing="1" cellPadding="2" width="100%" border="0">
																<tr class="bggrey">
																	<td vAlign="top" width="50%" height="13">
																		<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																			<TR>
																				<TD class="txtnormal" width="32%"><strong>Customer Name:</strong></TD>
																				<TD class="txtcolor2" width="68%"><strong>
																						<%=  MIMS_WRS.Business.CUser.GetName(PageBO.CustomerID) %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Packing:</strong></TD>
																				<TD class="txtcolor2"><strong>
																						<%= GetPackingTypeText %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Arrival Port:</strong></TD>
																				<TD class="txtcolor2" noWrap><strong>
																						<%= PageBO.DestinationPort %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Supplier Code:</strong></TD>
																				<TD class="txtcolor2"><strong><strong>
																							<%= PageBO.SupplierCode %>
																						</strong></strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><%= HttpUtility.HtmlEncode(OrderCustomer.SortReference1) %>:</strong></TD>
																				<TD class="txtcolor2"><strong>
																						<%= PageBO.SortReference %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><%= HttpUtility.HtmlEncode(OrderCustomer.SortReference2) %>:</strong></TD>
																				<TD class="txtcolor2"><strong>
																						<%= PageBO.SortReference2 %>
																					</strong>
																				</TD>
																			</TR>
																			<TR vAlign="top">
																				<TD class="txtnormal"><strong>Requested ETA:</strong></TD>
																				<TD class="txtcolor2"><strong><span class="txtcolor2"><%= GetRequestedETAText %></span></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" noWrap><strong>Containers:</strong></TD>
																				<TD class="txtcolor2"><strong><%= GetContainerText %></strong></TD>
																			</TR>
																		</TABLE>
																	</td>
																	<td vAlign="top" width="50%">
																		<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																			<TR>
																				<TD class="txtnormal" width="49%"><strong><asp:label id="lblOrderNoText" Runat="server"></asp:label>:
																					</strong>
																				</TD>
																				<TD class="txtcolor2" width="51%"><strong>
																						<%= PageBO.OrderNumber %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Shipping:</strong></TD>
																				<TD class="txtcolor2"><strong>
																						<%= GetShippingTypeText %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" noWrap><strong>Order Date:</strong></TD>
																				<TD class="txtcolor2"><strong><%= MIMS_WRS.Business.Common.FormatDate(PageBO.OrderDate) %></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Order By:</strong></TD>
																				<TD class="txtcolor2"><strong><%= GetContactName %></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><% if (PageBO.UserCountry="United States") then %>
																						UPC:<%else%>
																						EAN:<%end if%>
																					</strong>
																				</TD>
																				<TD class="txtcolor2"><strong>
																						<%= PageBO.UserBarCode %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Adjust By:</strong></TD>
																				<TD class="txtcolor2"><strong><%=  MIMS_WRS.Business.CUser.GetName(PageBO.AdjustedByID) %></strong></TD>
																			</TR>
																			<TR vAlign="top">
																				<TD class="txtnormal"><strong>Adjust Date: </strong>
																				</TD>
																				<TD class="txtcolor2"><strong><%= MIMS_WRS.Business.Common.FormatDate(PageBO.AdjustedDate) %></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" vAlign="top"><strong>General Shipping Instructions:</strong></TD>
																				<TD class="txtcolor2"><strong><%= PageBo.ShippingInstructions %></strong></TD>
																			</TR>
																		</TABLE>
																	</td>
																</tr>
															</table>
														</TD>
													</TR>
													<!-- View Order Form: end -->
													<!--Edit Order Form: start -->
													<tr id="trEditOrder" runat="server" visible="false">
														<TD class="txtnormal" align="center">
															<table class="bglinetop1" cellSpacing="1" cellPadding="2" width="100%" border="0">
																<tr class="bggrey">
																	<td vAlign="top" width="48%" height="13">
																		<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																			<TR>
																				<TD class="txtnormal" width="32%"><strong>Customer Name:</strong></TD>
																				<TD class="txtcolor2" width="68%"><strong></strong>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtCustomerName runat="server" CssClass="txtsmall" Width="116px" Text="<%# GetCustomerName %>" Font-Bold="True" ReadOnly="True" MaxLength="50" size="20">
																								</asp:textbox></td>
																							<td>&nbsp;</td>
																							<td>&nbsp;<INPUT class="txtsmall" id="hidCustomerID" type="hidden" name="hidCustomerID" runat="server"></td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Packing:</strong></TD>
																				<TD class="txtcolor2"><strong><asp:dropdownlist id="ddlPackingType" runat="server" CssClass="txtsmall"></asp:dropdownlist></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Arrival Port:</strong></TD>
																				<TD class="txtcolor2" noWrap>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtDestinationPort runat="server" CssClass="txtsmall" Width="116px" Text="<%# PageBO.DestinationPort %>" ReadOnly="True" MaxLength="50"></asp:textbox></td>
																							<td><A onclick="OpenLKList(this, window.document.getElementById('txtDestinationPort'), window.document.getElementById('hidDestinationPortID'), 'Select a port', 420, 180, destPortLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="1" src="../images/b_browse.gif" width="22" border="0"></A><A onclick="AddLK(this, window.document.getElementById('txtDestinationPort'), window.document.getElementById('hidDestinationPortID'), 'Enter a new port', 420, 180, destPortLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="4" src="../images/b_new.gif" width="72" border="0"></A></td>
																							<td><span class="txthighlight"><strong>*</strong></span>
																								<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" CssClass="txthighlight" Display="Dynamic"
																									ControlToValidate="txtDestinationPort" ErrorMessage="Missing destination port">required</asp:requiredfieldvalidator><INPUT class="txtsmall" id="hidDestinationPortID" type="hidden" name="hidDestinationPortID"
																									runat="server">
																							</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Supplier Code:</strong></TD>
																				<TD class="txtcolor2"><strong></strong>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtSupplierCode runat="server" CssClass="txtsmall" Width="116px" Text="<%# PageBO.SupplierCode %>" ReadOnly="True" MaxLength="3"></asp:textbox></td>
																							<td><A onclick="OpenSupplierCodeList(this, window.document.getElementById('txtSupplierCode'), window.document.getElementById('hidSupplierID'), 'Select a supplier code', 420, 180, supplierCodeLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="1" src="../images/b_browse.gif" width="22" border="0"></A><A onclick="AddLK(this, window.document.getElementById('txtSupplierCode'),  window.document.getElementById('hidSupplierID'),'Enter a new supplier', 420, 200, supplierCodeLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="4" src="../images/b_new.gif" width="72" border="0"></A></td>
																							<td><span class="txthighlight"><strong>*</strong></span>
																								<asp:requiredfieldvalidator id="reqvSupplierCode" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtSupplierCode"
																									ErrorMessage="Missing Supplier Code">required</asp:requiredfieldvalidator><INPUT class="txtsmall" id="hidSupplierID" type="hidden" name="hidSupplierID" runat="server">
																							</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><%= HttpUtility.HtmlEncode(OrderCustomer.SortReference1) %>:</strong></TD>
																				<TD class="txtcolor2"><strong></strong>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtSortRef runat="server" CssClass="txtsmall" Width="116px" Text="<%# PageBO.SortReference %>" ReadOnly="True" MaxLength="50"></asp:textbox></td>
																							<td><A onclick="OpenSortReferenceList(this, window.document.getElementById('txtSortRef'), window.document.getElementById('hidSortRefID'), 'Select a sort reference', 420, 180, sortRefLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="1" src="../images/b_browse.gif" width="22" border="0"></A><A onclick="AddLK(this, window.document.getElementById('txtSortRef'),  window.document.getElementById('hidSortRefID'),'Enter a sort reference', 420, 180, sortRefLKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="4" src="../images/b_new.gif" width="72" border="0"></A></td>
																							<td><span class="txthighlight"></span><asp:requiredfieldvalidator id="reqvSortRef" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtSortRef"
																									ErrorMessage="Missing sort reference" Enabled="False">required</asp:requiredfieldvalidator><INPUT class="txtsmall" id="hidSortRefID" type="hidden" name="hidSortRefID" runat="server"><FONT color="red"></FONT>
																							</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><%= HttpUtility.HtmlEncode(OrderCustomer.SortReference2) %>:</strong></TD>
																				<TD class="txtcolor2"><strong></strong>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtSortRef2 runat="server" CssClass="txtsmall" Width="116px" Text="<%# PageBO.SortReference2 %>" ReadOnly="True" MaxLength="50"></asp:textbox></td>
																							<td><A onclick="OpenSortReference2List(this, window.document.getElementById('txtSortRef2'), window.document.getElementById('hidSortRefID2'), 'Select a sort reference', 420, 180, sortRef2LKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="1" src="../images/b_browse.gif" width="22" border="0"></A><A onclick="AddLK(this, window.document.getElementById('txtSortRef2'),  window.document.getElementById('hidSortRefID2'),'Enter a sort reference', 420, 180, sortRef2LKID, 1)"
																									href="javascript:doNothing()"><IMG height="20" hspace="4" src="../images/b_new.gif" width="72" border="0"></A></td>
																							<td><span class="txthighlight"></span><asp:requiredfieldvalidator id="Requiredfieldvalidator2" runat="server" CssClass="txthighlight" Display="Dynamic"
																									ControlToValidate="txtSortRef2" ErrorMessage="Missing sort reference" Enabled="False">required</asp:requiredfieldvalidator><INPUT class="txtsmall" id="hidSortRefID2" type="hidden" name="hidSortRefID2" runat="server"><FONT color="red"></FONT>
																							</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR vAlign="top">
																				<TD class="txtnormal"><strong>Requested ETA:</strong></TD>
																				<TD class="txtcolor2">
																					<table class="txtnormal" cellSpacing="2" cellPadding="0" border="0">
																						<tr>
																							<td><asp:radiobutton id="radETAAsap" onclick="SwitchETA()" runat="server" CssClass="txtnormal" Text="As soon as possible"
																									Checked="True" GroupName="RequestedETA" BackColor="#F9F9F9"></asp:radiobutton></td>
																						</tr>
																					</table>
																					<table class="txtnormal" cellSpacing="2" cellPadding="0" border="0">
																						<tr>
																							<td class="txtnormal"><asp:radiobutton id="radETABefore" onclick="SwitchETA()" runat="server" CssClass="txtnormal" Text="Before"
																									GroupName="RequestedETA" BackColor="#F9F9F9"></asp:radiobutton></td>
																							<td><asp:textbox id="txtETABefore" runat="server" CssClass="txtsmall" Width="88px" ReadOnly="True"></asp:textbox></td>
																							<td><A onclick="popUpCalendar(this, window.document.getElementById('txtETABefore'), '<%= MIMS_WRS.Business.Common.GetDateFormat %>')" href="javascript:doNothing()" ><IMG id="btnETABefore" height="20" hspace="1" src="../images/b_date.gif" width="22" border="0"></A></td>
																						</tr>
																						<tr>
																							<td class="txtnormal"><asp:radiobutton id="radETAAfter" onclick="SwitchETA()" runat="server" CssClass="txtnormal" Text="After"
																									GroupName="RequestedETA" BackColor="#F9F9F9"></asp:radiobutton></td>
																							<td><asp:textbox id="txtETAAfter" runat="server" CssClass="txtsmall" Width="88px" ReadOnly="True"></asp:textbox></td>
																							<td><A onclick="popUpCalendar(this, window.document.getElementById('txtETAAfter'), '<%= MIMS_WRS.Business.Common.GetDateFormat %>')" href="javascript:doNothing()" ><IMG id="btnETAAfter" height="20" hspace="1" src="../images/b_date.gif" width="22" border="0"></A></td>
																						</tr>
																						<tr>
																							<td class="txtnormal"><asp:radiobutton id="radETABetween" onclick="SwitchETA()" runat="server" CssClass="txtnormal" Text="Between"
																									GroupName="RequestedETA" BackColor="#F9F9F9"></asp:radiobutton></td>
																							<td><asp:textbox id="txtETAFrom" runat="server" CssClass="txtsmall" Width="88px" ReadOnly="True"></asp:textbox></td>
																							<td><A onclick="popUpCalendar(this, window.document.getElementById('txtETAFrom'), '<%= MIMS_WRS.Business.Common.GetDateFormat %>')" href="javascript:doNothing()" ><IMG id="btnETAFrom" height="20" hspace="1" src="../images/b_date.gif" width="22" border="0"></A></td>
																						</tr>
																						<tr>
																							<td class="txtnormal" align="right" height="22">and</td>
																							<td><asp:textbox id="txtETATo" runat="server" CssClass="txtsmall" Width="88px" ReadOnly="True"></asp:textbox></td>
																							<td><A onclick="popUpCalendar(this, window.document.getElementById('txtETATo'), '<%= MIMS_WRS.Business.Common.GetDateFormat %>')" href="javascript:doNothing()" ><IMG id="btnETATo" height="20" hspace="1" src="../images/b_date.gif" width="22" border="0"></A></td>
																						</tr>
																					</table>
																					<strong></strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" noWrap><strong>Containers:</strong></TD>
																				<TD class="txtcolor2"><asp:textbox onkeypress="NumberOnly(0)" id="txtNoContainers" runat="server" CssClass="txtsmall"
																						Width="32px" MaxLength="2"></asp:textbox>&nbsp;<span class="txtnormal"><strong>x</strong></span><strong>
																						<asp:dropdownlist id="ddlContainerType" runat="server" CssClass="txtsmall" Width="120px"></asp:dropdownlist>&nbsp;<asp:comparevalidator id="comvContainerNo" runat="server" CssClass="txthighlight" ControlToValidate="txtNoContainers"
																							ErrorMessage="Container must greater than 0" ValueToCompare="0" Operator="GreaterThan" Type="Integer"></asp:comparevalidator>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" noWrap>&nbsp;</TD>
																				<TD class="txtcolor2">&nbsp;</TD>
																			</TR>
																		</TABLE>
																	</td>
																	<td vAlign="top" width="52%">
																		<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																			<TR>
																				<TD class="txtnormal" width="49%"><strong id="po">PO Number: </strong>
																				</TD>
																				<TD class="txtcolor2" width="51%"><strong></strong>
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:dropdownlist id="ddlOrderType" runat="server" CssClass="txtsmall" Enabled="False"></asp:dropdownlist></td>
																							<td><asp:textbox id="txtOrderNo" runat="server" CssClass="txtsmall" ReadOnly="True" MaxLength="10"
																									ToolTip="Order Number: 3 digits for BO, 10 digits for PO" size="18"></asp:textbox></td>
																							<td><span class="txthighlight"><strong>&nbsp;*</strong></span>
																								<asp:requiredfieldvalidator id="reqvOrderNo" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtOrderNo"
																									ErrorMessage="Missing customer order number">required</asp:requiredfieldvalidator><asp:regularexpressionvalidator id="regvOrderNo" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtOrderNo"
																									ErrorMessage="Order number must be alphanumeric characters" ValidationExpression="([a-zA-Z0-9]){0,10}">invalid format</asp:regularexpressionvalidator></td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Shipping:</strong></TD>
																				<TD class="txtcolor2"><asp:dropdownlist id="ddlShippingType" runat="server" CssClass="txtsmall"></asp:dropdownlist></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" noWrap><strong>Order Date:</strong></TD>
																				<TD class="txtcolor2">
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id="txtOrderDate" runat="server" CssClass="txtsmall" Width="88px" ReadOnly="True"
																									MaxLength="15"></asp:textbox></td>
																							<td>&nbsp;</td>
																							<td>&nbsp;</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Order By:</strong></TD>
																				<TD class="txtcolor2">
																					<table cellSpacing="0" cellPadding="0" border="0">
																						<tr>
																							<td><asp:textbox id=txtOrderBy runat="server" CssClass="txtsmall" Width="128px" Text="<%# GetContactName %>" Font-Bold="True" ReadOnly="True" MaxLength="50"></asp:textbox></td>
																							<td><A onclick="OpenCCList(this)" href="javascript:doNothing()"><IMG height="20" hspace="1" src="../images/b_browse.gif" width="22" border="0"></A><A onclick="AddCC(this)" href="javascript:doNothing()"><IMG height="20" hspace="4" src="../images/b_new.gif" width="72" border="0"></A></td>
																							<td><span class="txthighlight"><strong>*</strong></span>
																								<asp:requiredfieldvalidator id="reqvOrderBy" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtOrderBy"
																									ErrorMessage="Missing Order by">required</asp:requiredfieldvalidator><INPUT id="hidContactID" type="hidden" name="hidContactID" runat="server">
																							</td>
																						</tr>
																					</table>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong><% if (PageBO.UserCountry="United States") then %>
																						UPC:<%else%>
																						EAN:<%end if%>
																					</strong>
																				</TD>
																				<TD class="txtcolor2"><strong>
																						<%= PageBO.UserBarCode %>
																					</strong>
																				</TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal"><strong>Adjust By:</strong></TD>
																				<TD class="txtcolor2"><strong><%=  MIMS_WRS.Business.CUser.GetName(PageBO.AdjustedByID) %></strong></TD>
																			</TR>
																			<TR vAlign="top">
																				<TD class="txtnormal"><strong>Adjust Date: </strong>
																				</TD>
																				<TD class="txtcolor2"><strong><%= MIMS_WRS.Business.Common.FormatDate(PageBO.AdjustedDate) %></strong></TD>
																			</TR>
																			<TR>
																				<TD class="txtnormal" vAlign="top"><strong>General Shipping Instructions:</strong></TD>
																				<TD class="txtcolor2"><asp:textbox onkeypress="MaxlengthTextArea(this, 2000)" id="txtGeneralShippingInstructions" runat="server"
																						CssClass="txtsmall" Width="95%" TextMode="MultiLine" Rows="8"></asp:textbox><asp:regularexpressionvalidator id="regvSI" runat="server" CssClass="txthighlight" Display="Dynamic" ControlToValidate="txtGeneralShippingInstructions"
																						ErrorMessage="General Shipping Instruction must not contain > or <" ValidationExpression="([^<>])*">must not contain > or <                                                                                                                                                                                                                                                                                                                                                                                            </asp:regularexpressionvalidator></TD>
																			</TR>
																		</TABLE>
																	</td>
																</tr>
															</table>
														</TD>
													</tr>
													<!--Edit Order Form: End --></TABLE>
												<!--Create new  form -->
												<TABLE id="tbCreatNewForm" cellSpacing="0" cellPadding="3" width="100%" border="0" runat="server">
													<TR>
														<TD class="bgmenu" vAlign="bottom" height="20">
															<table cellSpacing="0" cellPadding="0" width="100%" border="0">
																<tr>
																	<td><strong class="txtnormal">&nbsp;Order's Complete Information</strong></td>
																	<td align="right">
																		<% If Not PageIsCustomer Then %>
																		<IMG style="CURSOR: hand" onclick="javascript:CreateOrderCompleteInformation();" height="18"
																			hspace="2" src="../images/b_completeinfo_create.gif" width="199" vspace="2" border="0">
																		<% End If %>
																	</td>
																</tr>
															</table>
														</TD>
													</TR>
													<TR>
														<TD class="txtnormal" align="center"></TD>
													</TR>
													<TR>
														<TD class="txtnormal" height="5"><IMG height="1" src="../images/1pxl.gif" width="1"></TD>
													</TR>
													<TR>
														<TD class="txtnormal">&nbsp;</TD>
													</TR>
													<TR>
														<TD class="txtnormal" height="5"><IMG height="1" src="../images/1pxl.gif" width="1"></TD>
													</TR>
												</TABLE>
												<!--Edit Form -->
												<TABLE id="tbEditForm" cellSpacing="0" cellPadding="3" width="100%" border="0" runat="server"
													visible="false">
													<TR>
														<TD class="bgmenu" vAlign="bottom" height="20"><a name="complete"></a>
															<table cellSpacing="0" cellPadding="0" width="100%" border="0">
																<tr>
																	<td><strong class="txtnormal">&nbsp;Order's Complete Information</strong></td>
																	<td align="right">
																		<% If Not PageIsCustomer Then %>
																		<IMG style="CURSOR: hand" onclick="javascript:CreateOrderCompleteInformation();" height="18"
																			hspace="2" src="../images/b_completeinfo_edit.gif" width="199" vspace="2" border="0">
																		<% End If %>
																	</td>
																</tr>
															</table>
														</TD>
													</TR>
													<TR>
														<TD class="txtnormal" align="center"></TD>
													</TR>
													<TR>
														<TD class="txtnormal" height="5"><IMG height="1" src="../images/1pxl.gif" width="1"></TD>
													</TR>
													<TR>
														<TD class="txtnormal">
															<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																<TR>
																	<TD class="txtnormal" noWrap width="19%">Actual Departure Date:</TD>
																	<TD class="txtcolor2" width="45%"><asp:label id="lblDepartureDate" runat="server">23/Aug/2004</asp:label></TD>
																	<TD class="txtnormal" width="14%">Container Number :</TD>
																	<TD class="txtcolor2" width="22%"><asp:label id="lblContainerNumber" runat="server">23345</asp:label></TD>
																</TR>
																<TR>
																	<TD class="txtnormal" style="HEIGHT: 18px">Destination:</TD>
																	<TD class="txtcolor2" style="HEIGHT: 18px"><asp:label id="lblDestination" runat="server">246 Ly Thuong Kiet</asp:label></TD>
																	<TD class="txtnormal" style="HEIGHT: 18px" vAlign="top">Comments:</TD>
																	<TD class="txtcolor2" style="HEIGHT: 18px" vAlign="top"><asp:label id="lblComments" runat="server">comments</asp:label></TD>
																</TR>
																<TR>
																	<TD class="txtnormal">Freight Forwarder:</TD>
																	<TD class="txtcolor2"><asp:label id="lblFreightForwarder" runat="server">Freight</asp:label></TD>
																	<TD class="txtnormal">&nbsp;</TD>
																	<TD class="txtcolor2">&nbsp;</TD>
																</TR>
															</TABLE>
														</TD>
													</TR>
													<TR>
														<TD class="txtnormal" height="5"><IMG height="1" src="../images/1pxl.gif" width="1"></TD>
													</TR>
												</TABLE>
												<table cellSpacing="0" cellPadding="0" width="100%" border="0">
													<tr>
														<td class="bgmenu" height="25">
															<table cellSpacing="0" cellPadding="0" width="100%" border="0">
																<tr>
																	<td height="30"><strong>&nbsp;</strong><span class="txtcolor1"><strong>Product(s) Line:</strong></span></td>
																	<td align="right"><asp:imagebutton id="btnAddOI" runat="server" ImageUrl="../Images/b_additem.gif"></asp:imagebutton>&nbsp;<asp:imagebutton id="btnRemoveOI" runat="server" ImageUrl="../Images/b_remove.gif"></asp:imagebutton></td>
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td><asp:datagrid id="DataGrid1" runat="server" BorderColor="#BFD6FB" GridLines="None" BorderStyle="None"
																cellpadding="2" cellspacing="1" CssClass="border" AutoGenerateColumns="False" BorderWidth="0px"
																Width="100%">
																<ItemStyle CssClass="bggrey"></ItemStyle>
																<HeaderStyle Font-Bold="True" HorizontalAlign="Center" CssClass="txtheader" VerticalAlign="Middle"></HeaderStyle>
																<Columns>
																	<asp:TemplateColumn>
																		<HeaderStyle Width="3%"></HeaderStyle>
																		<ItemTemplate>
																			<input type=checkbox onclick="Check_Onclick(this);" runat=server id="chkSelection" value='<%# DataBinder.Eval(Container, "DataItem.ID") %>' NAME="chkSelection">
																		</ItemTemplate>
																	</asp:TemplateColumn>
																	<asp:BoundColumn DataField="ProductCode" HeaderText="Product Code">
																		<HeaderStyle Width="11%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="ProductDescription" HeaderText="Description">
																		<HeaderStyle Width="28%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="Color" HeaderText="Color">
																		<HeaderStyle Width="7%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="BarCode" HeaderText="Barcode">
																		<HeaderStyle Width="10%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="Packing" HeaderText="Pack">
																		<HeaderStyle Width="8%"></HeaderStyle>
																		<ItemStyle HorizontalAlign="Right"></ItemStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="Quantity" HeaderText="Quantity Ordered">
																		<HeaderStyle Width="9%"></HeaderStyle>
																		<ItemStyle HorizontalAlign="Right"></ItemStyle>
																	</asp:BoundColumn>
																	<asp:BoundColumn DataField="SpecialInstructions" HeaderText="Special Instructions">
																		<HeaderStyle Width="10%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:TemplateColumn HeaderText="Adjusted Quantity">
																		<HeaderStyle Width="9%"></HeaderStyle>
																		<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
																		<ItemTemplate>
																			<asp:Label runat="server" Text='<%# GetAdjustedQuantityText(container) %>' ID="Label1">
																			</asp:Label>
																		</ItemTemplate>
																	</asp:TemplateColumn>
																	<asp:BoundColumn DataField="UseFromBoNumber2" HeaderText="From BO#">
																		<HeaderStyle Width="8%"></HeaderStyle>
																	</asp:BoundColumn>
																	<asp:TemplateColumn HeaderText="Edit">
																		<HeaderStyle Width="8%"></HeaderStyle>
																		<ItemTemplate>
																			<a runat="server" id="btnEdit" name="btnEdit" onclick="<%# GetEditIndex(Container) %>" onserverclick="btnEdit_OnClick" >
																				<img src="../images/b_edititem.gif" width="72" height="20" hspace="2" vspace="2" border="0"></a>
																		</ItemTemplate>
																	</asp:TemplateColumn>
																</Columns>
															</asp:datagrid>
															<TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
																<TR class="txtnormal">
																	<TD class="txtsmall" align="center">&nbsp;</TD>
																</TR>
																<TR class="txtnormal">
																	<TD class="txtsmall" align="center" height="30"><span class="txtcolor1s">
																			<asp:button id="btnArchived" runat="server" CssClass="button" CausesValidation="False" Text="Archive"></asp:button>
																			<asp:button id="btnPerRemove" runat="server" CssClass="button" Visible="False" Text="Permanently Remove"
																				Width="157px" CausesValidation="False"></asp:button>
																			<asp:button id="btnRemove" runat="server" CssClass="button" CausesValidation="False" Text="Remove"></asp:button>
																			<asp:button id="btnBack" runat="server" CssClass="button" CausesValidation="False" Text="Cancel"></asp:button>
																		</span>
																	</TD>
																</TR>
															</TABLE>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td height="10"><IMG height="1" src="../images/1pxl.gif" width="1"></td>
							</tr>
							<tr>
								<td align="right">&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
				<!-- DataTable: end -->
				<asp:button id="btnRefresh" style="DISPLAY: none" runat="server" Text="Refresh"></asp:button>
				<uc1:footer id="Footer1" runat="server"></uc1:footer></table>
		</form>
	</body>
</HTML>
